<template>
    <div>
        <p>child-1 组件</p>
        <el-button type="primary" @click="info_child_2">发布消息</el-button>
    </div>
</template>

<script>
    import PubSub from 'pubsub-js'

    export default {
        name: "Child_1",
        data() {
            return {
                tableData: [],
            }
        },
        methods: {
            info_child_2() {
                PubSub.publish('from_child_1', this.tableData)
            },

            GetOrdersData() {
                debugger
                var that = this
                this.$axios.post('http://127.0.0.1:80/sales/listorders/').then(function (response) {
                    console.log("-----------------------------------")
                    console.log(response)
                    that.tableData = response.data.retlist;
                    that.ProcessData();


                }).catch(function (error) {
                    console.log(error);
                });
            },

        },

        mounted() {
            this.GetOrdersData();
        }
    }
</script>

<style scoped>

</style>
